from socket import *


tcp_socket = socket(AF_INET, SOCK_STREAM)
tcp_socket.bind(("0.0.0.0", 8000))
tcp_socket.listen()

print("Waiting for a connect... ...")
conn, addr = tcp_socket.accept()
print("Connect has been done...", addr)

while True:
    data = conn.recv(1024)
    print(data)
    print("over:", data.decode())
    conn.send(b"Thanks")
    if not data or data.decode() == "##":
        break

conn.close()
tcp_socket.close()
